package com.huiyuanai.mapper;

import com.huiyuanai.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;

import java.util.Collection;
import java.util.List;

/**
 * @Author: liwan
 * @Description:
 * @Date: create in 2022/1/11/011
 */
@Mapper
public interface EmployeeMapper {
//    //假数据
//    private static Map<Integer, Employee> employees = null;

//    @Autowired
//    private DepartmentMapper departmentDao;
//
//    static {
//        employees = new HashMap<>();
//
//        employees.put(1001, new Employee(1001, "AA", "2916329883@qq.com", 0, new Department(101, "教学部")));
//        employees.put(1002, new Employee(1002, "BB", "2916329883@qq.com", 1, new Department(102, "市场部")));
//        employees.put(1003, new Employee(1003, "CC", "2916329883@qq.com", 0, new Department(103, "教研部")));
//        employees.put(1004, new Employee(1004, "DD", "2916329883@qq.com", 1, new Department(104, "运营部")));
//        employees.put(1005, new Employee(1005, "EE", "2916329883@qq.com", 0, new Department(105, "后勤部")));
//        employees.put(1006, new Employee(1006, "FF", "2916329883@qq.com", 1, new Department(106, "记者部")));
//    }

    //    //主键自增
//    private static Integer initId = 1006;
//
    //增加一个员工
    int add(Employee employee);

    //    {
//        if (employee.getId() == null) {
//            employee.setId(initId++);
//        }
//
//        if (employee.getCreateDate() == null) {
//            employee.setCreateDate(new Date());
//        }
//
////        employee.setDepartment(departmentDao.getDepatmentById(employee.getDepartment().getId()));
//        employees.put(employee.getId(), employee);
//    }
//
    //查询员工全部信息
    List<Employee> queryAllEmployee();

    //    {
//        return employees.values();
//    }
//
    //根据ID查找员工
    Employee getEmployeeById(Integer id);

    //    {
//        return employees.get(id);
//    }
//
    //删除员工信息
    int delById(Integer id);
//    {
//        employees.remove(id);
//    }

    //更新员工信息
    int upById(Employee employee);
}
